<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>产品名称</title>
	<link rel="stylesheet" href="css/base.css">
	<link rel="stylesheet" href="css/style.css">
	<style>
		body{ background-color: #f9f9f9;}
	</style>
</head>

<body>

	<%@include file="common/header.jsp" %>

	<div id="wrapper" class="clearfix">

		<a href="#" id="back-to-top"></a>
		
		<!-- 面包屑 开始 -->
		<div class="d-crumbs">
			<a href="#">首页</a>&nbsp;&nbsp;>&nbsp;&nbsp;
			<a href="#">${father }</a>&nbsp;&nbsp;>&nbsp;&nbsp;
			<!-- <a href="#">${product.productid}</a>&nbsp;&nbsp;>&nbsp;&nbsp; -->
			<span>${product.title}</span>
		</div>
		<!-- 面包屑 结束 -->
		
		<!-- 产品幻灯片 开始 -->
		<div class="d-slide">
			<div id="products">
				<div class="slides_container">
				
				<s:iterator value="listProductFile" id="list">
					<s:if test="#list.mainPic == 0">
						<a href="#"><img src="<%=basePath%>upload/product/<s:property value="#list.saveName"/>" alt="product"></a>
					</s:if>
				</s:iterator>
				</div>
				<p>----------------------------------&nbsp;&nbsp;&nbsp;产品详情&nbsp;&nbsp;&nbsp;---------------------------------------------</p>
				<ul class="pagination">
					<s:iterator value="listProductFile" id="list">
						<s:if test="#list.mainPic == 0">
						<li>
							<a href="#"><img src="<%=basePath%>upload/product/<s:property value="#list.saveName"/>" alt="thumb"></a>
						</li>
						</s:if>
					</s:iterator>
				</ul>
			</div>
		</div>
		<!-- 产品幻灯片 结束 -->

		<!-- 产品参数 开始 -->
		<div class="d-argument">
			<h2>${product.title}</h2>
			<table>
				<tr>
					<td width="15%">尺&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
					<td width="85%" class="lh-td3">
						<s:generator val="product.productsize" separator="," var="size">
						</s:generator>
						<s:iterator value="#size">
							<a href="#"><s:property/></a>
						</s:iterator>
					</td>
				</tr>
				<tr>
					<td>款&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;式：</td>
					<td class="lh-td3">
						<s:generator val="product.bspecification" separator="," var="bspecification">
						</s:generator>
						<s:iterator value="#bspecification">
							<a href="#"><s:property/></a>
						</s:iterator>
					</td>
					</td>
				</tr>
				<tr>
					<td>颜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;色：</td>
					<td class="lh-td3">
						<s:generator val="product.color" separator="," var="color">
						</s:generator>
						<s:iterator value="#color">
							<a href="#"><s:property/></a>
						</s:iterator>
					</td>
				</tr>
				<tr>
					<td>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签：</td>
					<td>
						<s:generator val="product.standard" separator="," var="productstandard">
						</s:generator>
						<s:iterator value="#productstandard">
							<a href="#"><s:property/></a>
						</s:iterator>
					</td>
				</tr>
			</table>

			<a class="purchase" href="${product.material}">￥<s:property value="product.price"/>&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/purchase_cart.png" />&nbsp;&nbsp;前往购买</a>
		</div>
		<!-- 产品参数 结束 -->

		<!-- 产品介绍 开始 -->
		<div class="d-content">
			<h2>产品介绍</h2>
			${product.content}
		</div>
		<!-- 产品介绍 结束 -->

		<!-- 产品推荐 开始 -->
		<div class="d-recommend clearfix">
			<h2>相似推荐</h2>
			<s:if test="father == 'T恤'">
				<s:action name="getProductListShowDetail" executeResult="true">
					<s:param name="categoryid">402881e43a3fd17f013a3fda61b50001</s:param>
					<s:param name="currentPage">1</s:param>
					<s:param name="pageSize">12</s:param>
				</s:action>
			</s:if>
			<s:elseif test="father == '球服'">
				<s:action name="getProductListShowDetail" executeResult="true">
					<s:param name="categoryid">402881e43a3fd17f013a3fdaa0840002</s:param>
					<s:param name="currentPage">1</s:param>
					<s:param name="pageSize">12</s:param>
				</s:action>
			</s:elseif>
			<s:elseif test="father == '衬衫'">
				<s:action name="getProductListShowDetail" executeResult="true">
					<s:param name="categoryid">402881e43a3fd17f013a3fdad84e0003</s:param>
					<s:param name="currentPage">1</s:param>
					<s:param name="pageSize">12</s:param>
				</s:action>
			</s:elseif>
			<s:elseif test="father == '正装'">
				<s:action name="getProductListShowDetail" executeResult="true">
					<s:param name="categoryid">402881e43a3fd17f013a3fdafd470004</s:param>
					<s:param name="currentPage">1</s:param>
					<s:param name="pageSize">12</s:param>
				</s:action>
			</s:elseif>
			<s:elseif test="father == '礼服'">
				<s:action name="getProductListShowDetail" executeResult="true">
					<s:param name="categoryid">402881e43a3fd17f013a3fdb1c520005</s:param>
					<s:param name="currentPage">1</s:param>
					<s:param name="pageSize">12</s:param>
				</s:action>
			</s:elseif>
		</div>
		<!-- 产品推荐 结束 -->
	</div>

	<%@include file="common/footer.jsp" %>

<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/slides.min.jquery.js"></script>
<script>
$(function(){
	
	$(window).scroll(function(){
		if ($(window).scrollTop()>100){
			$("#back-to-top").fadeIn(1500); }
		else{
			$("#back-to-top").fadeOut(1500); }
	});

	$("#back-to-top").click(function(){
		$('body,html').animate({scrollTop:0},1000);
		return false;
	});
	
	$(".p-item").hover(function(){
		$(this).find("p").animate({bottom:'0'},50);
	}, function(){
		$(this).find("p").animate({bottom:'-20px'},50);
	});

	$(".d-argument table tr td a").toggle(function(){
		$(this).css("border","2px solid #ff6701");
	}, function(){
		$(this).css("border","1px solid #ccc");
	});
	
	$('#products').slides({
		preload: true,
		preloadImage: 'images/loading.gif',
		effect: 'slide, fade',
		crossfade: true,
		slideSpeed: 350,
		fadeSpeed: 500,
		generatePagination: false
	});
});
</script>
</body>
</html>
